﻿<%@ Page Title="Seznam uživatelů" Language="C#" MasterPageFile="~/Pages/Site.Master" AutoEventWireup="true" CodeBehind="HomePage.aspx.cs" Inherits="Altairis.FluffyCloud.WebCore.Pages.Users.HomePage" %>
<asp:Content ContentPlaceHolderID="Main" runat="server">
    <h1>Seznam uživatelů</h1>
    <asp:ListView ID="UserList" runat="server" ItemType="Altairis.FluffyCloud.Data.User" SelectMethod="UserList_GetData">
        <LayoutTemplate>
            <table class="grid">
                <thead>
                    <tr>
                        <th>Ikona</th>
                        <th>Uživatel<br />
                            Komentář</th>
                        <th>Druh</th>
                        <th>Datum registrace<br />
                            Poslední aktivita</th>
                    </tr>
                </thead>
                <tbody>
                    <asp:PlaceHolder ID="ItemPlaceHolder" runat="server" />
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="4">
                            <div class="left">
                                <asp:HyperLink ID="LinkFirst" runat="server" Text="&#x25C0; první" />
                                <asp:HyperLink ID="LinkPrevious" runat="server" Text="&#x25C0; předchozí" />
                            </div>
                            <div class="right">
                                <asp:HyperLink ID="LinkNext" runat="server" Text="další &#x25B6;" />
                                <asp:HyperLink ID="LinkLast" runat="server" Text="poslední &#x25B6;" />
                            </div>
                            <asp:Literal ID="LiteralPagerInfo" runat="server" Text="celkem {2} uživatelů, stránka {3} z {4} " />
                        </td>
                    </tr>
                </tfoot>
            </table>
        </LayoutTemplate>
        <ItemTemplate>
            <tr>
                <td style="width: 40px">
                    <my:UserIcon runat="server" UserName="<%# Item.UserName %>" Size="40" NavigateUrl='<%# this.GetRouteUrl("UserProfile", new { username = Item.UserName }) %>' />
                </td>
                <td>
                    <a href='<%# this.GetRouteUrl("UserProfile", new { username = Item.UserName }) %>' class="strong"><%#: Item.UserName.ToUpper() %></a><br />
                    <%#: Item.Comment %>
                </td>
                <td><%#: Item.Species %></td>
                <td class="r"><%#: Item.DateCreated.ToLocalDisplayFormat() %><br />
                    <%#: Item.DateLastActivity.HasValue ? Item.DateLastActivity.Value.ToLocalDisplayFormat() : "nikdy" %></td>
            </tr>
        </ItemTemplate>
    </asp:ListView>
    <altairis:DataPagerExtender runat="server" TargetControlID="UserList" PageSize="20" PageIndexSource="RouteParameter" FirstLinkID="LinkFirst" LastLinkID="LinkLast" NextLinkID="LinkNext" PreviousLinkID="LinkPrevious" InfoLabelID="LiteralPagerInfo" InactiveLinkMode="Disable" />
</asp:Content>